﻿@using MvcForum.Web.Application.ExtensionMethods
@model MvcForum.Web.ViewModels.Admin.CategoryEditViewModel

<div class="form-group">
    @Html.LabelFor(model => model.CategoryColour)
    @Html.EditorFor(model => model.CategoryColour)
    @Html.ValidationMessageFor(model => model.CategoryColour)
</div>

<div class="form-group">
    @Html.LabelFor(model => model.Name)
    @Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
    @Html.ValidationMessageFor(model => model.Name)
</div>

<div class="form-group">
    @Html.LabelFor(model => model.Description)
    @Html.EditorFor(model => model.Description)
    @Html.ValidationMessageFor(model => model.Description)
</div>

<div class="row categoryimage">

    @if (!string.IsNullOrEmpty(Model.Image))
    {
        <div class="col-md-2">
            <p><img src="@AppHelpers.CategoryImage(Model.Image, Model.Id,110)" alt="@Model.Name" class="img-responsive" /></p>
            <p><a class="btn-mvc" href="@Url.Action("RemoveCategoryImage", "AdminCategory", new { id =  Model.Id, area = "Admin" })">Remove Image</a></p> 
        </div>
    }

    <div class="col-md-10">
        @Html.LabelFor(x => x.Files)
        <div class="input-group">
            <span class="input-group-btn">
                <span class="btn btn-default btn-file">
                    @Html.LanguageString("Post.Browse") <input type="file" name="files" id="files" value="">
                </span>
            </span>
            <input type="text" class="form-control" readonly="">
        </div>
        @Html.ValidationMessageFor(x => x.Files)
    </div>
</div>

<div class="checkbox">
    @using (Html.BeginLabelFor(m => m.IsLocked, new { @class = "checkbox" }))
    {
        @Html.CheckBoxFor(m => m.IsLocked)
    }
    @Html.ValidationMessageFor(m => m.IsLocked)
</div>

<div class="checkbox">
    @using (Html.BeginLabelFor(m => m.ModerateTopics, new { @class = "checkbox" }))
    {
        @Html.CheckBoxFor(m => m.ModerateTopics)
    }
    @Html.ValidationMessageFor(m => m.ModerateTopics)
</div>

<div class="checkbox">
    @using (Html.BeginLabelFor(m => m.ModeratePosts, new { @class = "checkbox" }))
    {
        @Html.CheckBoxFor(m => m.ModeratePosts)
    }
    @Html.ValidationMessageFor(m => m.ModeratePosts)
</div>

<div class="form-group">
    @Html.LabelFor(model => model.SortOrder)
    @Html.TextBoxFor(model => model.SortOrder, new { @class = "form-control", type = "number" })
    @Html.ValidationMessageFor(model => model.SortOrder)
</div>

<div class="form-group">
    @Html.LabelFor(model => model.ParentCategory)
    @Html.DropDownListFor(model => model.ParentCategory, Model.AllCategories, new { @class = "form-control" })
    @Html.ValidationMessageFor(model => model.ParentCategory)
</div>

<div class="form-group">
    @Html.LabelFor(model => model.Section)
    <p class="help-block">Sections only apply to main categories.</p>
    @Html.DropDownListFor(model => model.Section, Model.AllSections, new { @class = "form-control" })
    @Html.ValidationMessageFor(model => model.Section)
</div>

<hr />

<div class="form-group">
    @Html.LabelFor(model => model.PageTitle)
    @Html.TextBoxFor(model => model.PageTitle, new { @class = "form-control" })
    @Html.ValidationMessageFor(model => model.PageTitle)
</div>

<div class="form-group">
    @Html.LabelFor(model => model.MetaDesc)
    @Html.TextAreaFor(model => model.MetaDesc, new { @class = "form-control" })
    @Html.ValidationMessageFor(model => model.MetaDesc)
</div>

